load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "tikvhandler",
    srcs = [
        "dxf.go",
        "tikv_handler.go",
    ],
    importpath = "github.com/pingcap/tidb/pkg/server/handler/tikvhandler",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/config",
        "//pkg/ddl",
        "//pkg/disttask/framework/handle",
        "//pkg/disttask/framework/schstatus",
        "//pkg/domain",
        "//pkg/domain/infosync",
        "//pkg/domain/serverinfo",
        "//pkg/executor",
        "//pkg/infoschema",
        "//pkg/infoschema/context",
        "//pkg/keyspace",
        "//pkg/kv",
        "//pkg/lightning/backend/local",
        "//pkg/meta",
        "//pkg/meta/metadef",
        "//pkg/meta/model",
        "//pkg/parser/ast",
        "//pkg/parser/terror",
        "//pkg/server/handler",
        "//pkg/session",
        "//pkg/session/sessionapi",
        "//pkg/session/txninfo",
        "//pkg/sessionctx",
        "//pkg/sessionctx/vardef",
        "//pkg/sessionctx/variable",
        "//pkg/store/gcworker",
        "//pkg/store/helper",
        "//pkg/table",
        "//pkg/tablecodec",
        "//pkg/types",
        "//pkg/util",
        "//pkg/util/codec",
        "//pkg/util/deadlockhistory",
        "//pkg/util/gcutil",
        "//pkg/util/hack",
        "//pkg/util/logutil",
        "//pkg/util/sqlexec",
        "@com_github_gorilla_mux//:mux",
        "@com_github_pingcap_errors//:errors",
        "@com_github_pingcap_failpoint//:failpoint",
        "@com_github_pingcap_log//:log",
        "@com_github_tikv_client_go_v2//tikv",
        "@com_github_tikv_client_go_v2//util",
        "@com_github_tikv_pd_client//clients/router",
        "@com_github_tikv_pd_client//http",
        "@com_github_tikv_pd_client//opt",
        "@org_uber_go_zap//:zap",
    ],
)

go_test(
    name = "tikvhandler_test",
    timeout = "short",
    srcs = ["dxf_test.go"],
    embed = [":tikvhandler"],
    flaky = True,
    deps = [
        "//pkg/disttask/framework/schstatus",
        "@com_github_stretchr_testify//require",
    ],
)
